<!DOCTYPE html>
<html lang="en">
<head>
    <title>支持</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
</head>
<style type="text/css">
    .table-width{
        width: 580px;
    }
    .table-width-area{
        width: 780px;
    }
    .title{
        font-size: 20px;
        text-align: center;
        margin-bottom: 10px;
    }
    .row {
        margin-right: -15px;
        margin-left: 0px;
    }
    .col-md-12 {
        padding-left: 0;
    }
</style>
<body>
<section class="content"  id="app">
    <!--集团管理层-->
    <table class="table table-hover table-bordered text-center table-width">
        <thead><tr>
            <td style="width: 80px;">部门/大区</td>
            <th style="width: 100px;">姓名</th>
            <td style="width: 80px;">岗位</td>
            <th style="width:80px">在职状态</th>
            <td style="width: 270px;">区域</td>
        </tr>
        </thead>
        <tbody>
        <tr v-for="(item,i) in supportRegionList" v-cloak>
            <td :rowspan="item.departNamespan" :class="{hidden: item.departNamedis}">{{item.departName}}</td>
            <td style="color:#169BD5;cursor: pointer"  @click="personnelDepartList(item)" v-if="item.name!='空缺'">{{item.name}}</td>
            <td v-if="item.name=='空缺'"  style="color: red">{{item.name}}</td>
            <td :rowspan="item.roleNamespan" :class="{hidden: item.roleNamedis}">{{item.roleName}}</td>
            <td v-if="item.jobState===0||item.jobState=='-'"></td>
            <td v-else-if="item.jobState == -1">试用</td>
            <td v-else-if="item.jobState == -2">试岗</td>
            <td v-else>离职</td>
            <td style="text-align: left">{{item.regionName}}</td>
        </tr>

        <!--</tr>-->
        </tbody>
    </table>
    <!-- /.box-body -->
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=602456c3"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=6348cbbc"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">
    console.log(urlConfig);
    var app = new Vue({
        el:'#app',
        data:{
            currentUser:getCurrentUser(),
            supportRegionList:[]
        },
        methods:{
            personnelDepartList: function (item) {
                top.addTabs({
                    id: "look"+item.userId,
                    title: item.name+"详情",
                    close: true,
                    url: '/personnel/entry.html?id=' + item.userId + '&pageType=look'
                });
            },
            tablesMergeCell:function(list){
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },

        },
        mounted:function () {
            var that = this;
            $.wyui.postMethod(urlConfig.crm.personnel.getSupportRegionList, {
                //"userId": "20171216203048A0A7E90A366470DBE0",
                "userId": that.currentUser.id,
            }, function (map) {
                console.log(map);
                that.supportRegionList = that.tablesMergeCell(map);
            });
        }
    });
</script>

</body>
</html>